package com.chuck.blogpro.service.impl;

import com.chuck.blogpro.mapper.TagMapper;
import com.chuck.blogpro.pojo.Tag;
import com.chuck.blogpro.service.TagService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class TagServiceImpl implements TagService {

    @Autowired
    private TagMapper mapper;

    @Override
    public void getTags() {

    }

    @Override
    public List<Tag> list() {
        return mapper.list();
    }

    @Override
    public Tag getTag(Integer id) {
        return mapper.getTag(id);
    }

    @Override
    public void delete(Integer id) {
        mapper.delete(id);
    }

    @Override
    public void add(Tag tag) {
        mapper.add(tag.getName());
    }

    @Override
    public void update(Tag tag) {
        mapper.update(tag);
    }
}
